<template>
  <div class="business_see">
    <titleDiv
      :title="title"
      :isShow="true"
      text1="创建人："
      text2="创建时间："
      :value1="obj.personName"
      :value2="obj.creatTime"
    ></titleDiv>
    <div class="main">
      <el-form ref="form"  label-width="100px">
				<el-form-item label="设备类型：">
					<div v-if="obj.type == 'qhj' " class="textInner">取号机</div>
					<div v-else-if="obj.type == 'hjq' " class="textInner">呼叫器</div>
					<div v-else-if="obj.type == 'led' " class="textInner">LED屏</div>
					<div v-else-if="obj.type == 'pjq' " class="textInner">评价器</div>
					<div v-else-if="obj.type == 'dp' " class="textInner">电视机</div>
				</el-form-item>
        <el-form-item label="设备名称：">
          <div class="textInner">{{obj.name}}</div>
        </el-form-item>
        <el-form-item label="地址码：">
          <div class="textInner">{{obj.uniqueldentifier}}</div>
        </el-form-item>
        <el-form-item label="连接窗口：">
          <div class="textInner">{{obj.windowName}}</div>
        </el-form-item>
        <el-form-item label="设备品牌：">
          <div class="textInner">{{obj.manufacturer}}</div>
        </el-form-item>
        <el-form-item label="生产厂家：">
          <div class="textInner">{{obj.manufacturer}}</div>
        </el-form-item>
        <el-form-item label="设备型号：">
          <div class="textInner">{{obj.equipmentmodel}}</div>
        </el-form-item>
        <el-form-item label="连接状态：">
          <div class="textInner">
						<span v-if="obj.isState == true" style="color: #11a254;">连接正常</span> 
						<span v-else>连接异常<i>  {{obj.connExceptionTime}}</i> </span>
					</div>
        </el-form-item>
        <el-form-item label="备注：">
          <div class="textInner">{{obj.welcomelanguage}}</div>
        </el-form-item>
       
        <!-- <el-button class="btn" type="primary">编辑</el-button>
        <el-button class="btn btnsc" type="primary">删除</el-button> -->
      </el-form>
    </div>
  </div>
</template>
<script>
  import titleDiv from './view/titleDiv.vue'
	import {getFacilityDetail} from '../api/getData'
  export default {
    name: 'business_see',
    data: function () {
      return {
				id:'',
				windowId:'',
        title:"设备详情",
				obj:{},
        name:'XXXX',
        time:'2018-11-01 09:15'
      }
    },
    components:{
      titleDiv
    },
    created() {
			this.getParams()
		}, // 创建时
    beforeMount() {}, // 挂载之前
    mounted() {
			this.getDetail()
		}, // 挂载之后
    beforeUpdate() {}, // 数据更新时调用,在渲染之前
    updated() {}, // 数据更新后,渲染后调用(禁止)
    beforeDestroy() {}, // 实例销毁前调用,解绑中间层的数据传输
    destroyed() {}, // 实例销毁后调用
    methods: {
			getParams(){
				this.id = this.$route.query.id 
				this.windowId = this.$route.query.windowId
				console.log(this.id,this.windowId)
			},
			getDetail(){
				getFacilityDetail({
					id:this.id,
					windowId:this.windowId
				}).then((res) =>{
					console.log(res)
					if(res.data.code == 0){
						this.obj = res.data.data
					}
				}).catch((error) =>{
					console.log(error)
				})
			}
		} // 函数
  }
</script>
<style lang='scss' scouped>
  .business_see {
    box-sizing: border-box;
    .main{
      background: #fff;
      width: 100%;
      margin-top: 3%;
      padding: 5% 20%;
      .textInner{
        color: #808492;
        font-size: 14px;
      }
      .el-form-item{
        margin-bottom:0;
        span{
          color:red;
          padding-right:  10px;
        }
        i{
          font-style: normal;
        }
      }
      .el-form-item__label{
        font-weight: bold;
      }
      .btn{
        width: 120px;
        height:32px;
        line-height: 1px;
        margin-left: 100px;
        margin-top: 40px;
      }
      .btnsc{
        background-color: #fff;
        border:1px solid #ccc;
        color: #ccc;
      }
    }
  }
</style>
